package amq.brokers;

import org.apache.activemq.broker.BrokerService;

public class SimpleBK {

	/**
	 * BD: Simple Broker for JSFramework
	 * @param args
	 */
	public static void main(String[] args) throws Exception{
		if(args.length==0)
		{
			System.out.printf("\t[Info] Please give Connector URI! (ex 'tcp://localhost:61616')\n");
			return;
		}
		BrokerService broker = new BrokerService();  
	    broker.setBrokerName("myBroker");  
	    broker.setDataDirectory("data/"); 

	    broker.addConnector(args[0]); //   
	    broker.start();  
	    System.out.println();  
	    System.out.println("Press any key to stop the broker");  
	    System.out.println();  
	    System.in.read();
	    broker.stop();
	    System.out.printf("\t[Info] Exit broker...\n");
	}

}
